#include "stdafx.h"
#include "Base.h"
#include "User.h"
#include "UserManager.h"
#include "BusinessServer.h"
#include "Packet.h"
#include "ShopManager.h"
#include "PacketCreator.h"
#include "PacketFactory.h"

Packet* PacketCreator::FORWARD_BROADCAST_COMMAND(Binary &BinCommand,uint32 GID)
{
	uint64  A;
	uint32  unk;
	Binary B;
	B.size(12);
	uint64 unk2;
	Binary C;
	BinCommand>>A;
	BinCommand>>unk;
	BinCommand>>B;
	BinCommand>>unk2;
	C.size(BinCommand.getleft());
	BinCommand>>C;
    //

	Packet  *pSendMsg = PacketFactory::Instance()->Alloc();
    *pSendMsg<<A;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<B;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<GID;
	*pSendMsg<<C;
	return pSendMsg;

}

Packet* PacketCreator::GIVE_ITEM(uint32 GID)
{
	Packet  *pSendMsg = PacketFactory::Instance()->Alloc();
	*pSendMsg<<(uint32)0x0a090300;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<GID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<GID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00003300;
	*pSendMsg<<(uint32)0;

	return pSendMsg;
}

Packet* PacketCreator::SPAWN_CLEAR(uint32 DestGID,uint32 QuestID,uint32 ZoneID,uint8 value)
{
	Packet  *pSendMsg = PacketFactory::Instance()->Alloc();
    *pSendMsg<<(uint32)0x12050300;
    *pSendMsg<<(uint16)0xffff;
	Binary BinPad;
	BinPad.BytesPad(0,18);
    *pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<QuestID;
	*pSendMsg<<ZoneID;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<value;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	return pSendMsg;
}

Packet* PacketCreator::SHOP_LIST( SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   
	Packet  *pSendMsg = PacketFactory::Instance()->Alloc();
	uint32  DestGID = 0;
	uint8   NbItems = 0;
	Binary  ItemsBin;
	uint32  length = 0;
	uint32  shopId = 0;
	//fill ItemsBin
	ShopManager::Instance()->GetItemList(shopId,ItemsBin);
	//
	*pSendMsg<<(uint32)0x010a0300;//head
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint16)1;
	*pSendMsg<<NbItems;
	*pSendMsg<<(uint8)2;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<ItemsBin;
	return pSendMsg;
}

Packet* PacketCreator::CHAR_INFO( SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize )
{
	/*
	<< 16#010d0300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little,
	0:64, 1:32/little, 0:32, 16#00000300:32, 16#ffff0000:32, 0:32, CharGID:32/little,
	0:192, CharGID:32/little, CharLID:32/little, 16#ffffffff:32, CharBin/binary >>
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary CharBin;
	//fill charBin

	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x010d0300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<(uint32)DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0x00000300;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<CharBin;
	return pSendMsg;
}

Packet* PacketCreator::CHAR_TRIGGER_EVENT(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#01110300:32, DestLID:16/little, 0:48, CharGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64,
	CharGID:32/little, CharLID:32/little, EventID:32/little, Param:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	Binary BinPad;
	BinPad.BytesPad(0,6);
	*pSendMsg<<(uint32)0x01110300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<CharGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharGID;
	*pSendMsg<<CharLID;
	*pSendMsg<<EventID;
	*pSendMsg<<Param;
	return pSendMsg;
}

Packet* PacketCreator::TYPES_CAPABILITY_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#01130300:32, 0:64, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, DestGID:32/little, File/binary >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	Binary FileBin;
	*pSendMsg<<(uint32)0x01130300;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestGID;
	*pSendMsg<<FileBin;
	return pSendMsg;

}

Packet* PacketCreator::UPDATE_CHAR_STATUS(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#01150300:32, DestLID:16/little, 0:48, CharGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64,
	CharGID:32/little, CharLID:32/little, EnemyTargetID:32/little, (build_char_level(User))/binary >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	Binary CharLevelBin;
	Binary BinPad;
	BinPad.BytesPad(0,6);
	*pSendMsg<<(uint32)0x01150300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<CharGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharGID;
	*pSendMsg<<CharLID;
	*pSendMsg<<EnemyTargetID;
	*pSendMsg<<CharLevelBin;
	return pSendMsg;

}

Packet* PacketCreator::REVIVE_PLAYER_SE(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#01170300:32, DestLID:16/little, 0:48, CharGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64,
	CharGID:32/little, CharLID:32/little, SE/binary, HP:32/little, 0:32 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharLevelBin;
	Binary SEBin;
	Binary BinPad;
	BinPad.BytesPad(0,6);
	*pSendMsg<<(uint32)0x01170300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<CharGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharGID;
	*pSendMsg<<CharLID;
	*pSendMsg<<SEBin;
	*pSendMsg<<hp;
	*pSendMsg<<(uint32)0;
	return pSendMsg;
}

Packet* PacketCreator::ZONE_INIT(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   
	/*
	packet_send(Client, << 16#02000300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64,
	DestLID:16/little, ZoneID:16/little, 1:32/little, 16#ffffffff:32, Var/binary, 16#ffffffff:32, 16#ffffffff:32 >>).
	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 ZoneID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharLevelBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x02000300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestLID;
	*pSendMsg<<ZoneID;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<VarBin;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	return pSendMsg;

}

Packet* PacketCreator::CHAR_STATUS_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02010300:32, DestLID:16/little, 0:16, CharTypeID:32, CharGID:32/little,
	0:64, 16#00011300:32, DestGID:32/little, 0:64, CharBin/binary, IsGM:8, 0:8, OnlineStatus:8, GameVersion:8, 0:608 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint16 ZoneID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,76);
	*pSendMsg<<(uint32)0x02010300;
	*pSendMsg<<DestLID;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<CharTypeID;
	*pSendMsg<<CharGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharBin;
	*pSendMsg<<IsGM;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<OnlineStatus;
	*pSendMsg<<GameVersion;
	*pSendMsg<<BinPad;

	return pSendMsg;
}

Packet* PacketCreator::CONNECT_HELLO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{  
	/*
	packet_send(Client, << 16#020203bf:32, DestLID:16/little, 0:272, DestGID:32/little, 0:1024 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint16 ZoneID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,34);
	Binary BinPad2;
	BinPad2.BytesPad(0,128);
	*pSendMsg<<(uint32)0x020203bf;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<DestGID;
	*pSendMsg<<BinPad2;
	return pSendMsg;

}

Packet* PacketCreator::SPAWN_PLAYER_EVENT(CommonParam &Param,uint32 EventID)
{
	
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint32 unk = 0;
	*pSendMsg<<(uint32)0x01110300;
	*pSendMsg<<Param.UserLID;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<Param.CharGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<Param.UserGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<Param.CharGID;
	*pSendMsg<<Param.CharLID;
	*pSendMsg<<EventID;
	*pSendMsg<<unk;
	return pSendMsg;




}

Packet* PacketCreator::SPAWN_PLAYER(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02030300:32, DestLID:16/little, 0:144, 16#00011300:32,
	DestGID:32/little, 0:64, CharGID:32/little, CharLID:32/little >>).

	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint16 ZoneID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x02030300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharGID;
	*pSendMsg<<CharLID;
	return pSendMsg;
}

Packet* PacketCreator::UNSPAWN_PLAYER(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02040300:32, DestLID:16/little, 0:16, CharTypeID:32, CharGID:32/little, 0:64,
	16#00011300:32, DestGID:32/little, 0:64, CharGID:32/little, CharLID:32/little, 100:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint16 ZoneID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x02040300;
	*pSendMsg<<DestLID;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<CharTypeID;
	*pSendMsg<<CharGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharGID;
	*pSendMsg<<CharLID;
	*pSendMsg<<(uint32)100;

	return pSendMsg;
}


Packet* PacketCreator::LOAD_NEW_MAP(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   
	/*
	packet_send(Client, << 16#02050300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64,
	16#ffffffff:32, ZoneID:32/little, MapID:32/little, EntryID:32/little, AreaNb:32/little, CharLID:16/little, 0:8, IsSeasonal:8 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsSeasonal = 0;
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint32 ZoneID = 0;
	uint32 MapID = 0;
	uint32 AreaNb = 0;
	uint32 EntryID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x02050300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<ZoneID;
	*pSendMsg<<MapID;
	*pSendMsg<<EntryID;
	*pSendMsg<<AreaNb;
	*pSendMsg<<CharLID;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<IsSeasonal;
	return pSendMsg;
}

Packet* PacketCreator::LOAD_NEW_MAP_END(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#02080300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64, AreaNb:32/little >>).
	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsSeasonal = 0;
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint32 ZoneID = 0;
	uint32 MapID = 0;
	uint32 AreaNb = 0;
	uint32 EntryID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x02080300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<AreaNb;
	return pSendMsg;
}

Packet* PacketCreator::PKT_0x020C(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   
	/*
	packet_send(Client, << 16#020c0200:32, 16#ffff0000:32, 0:256 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsSeasonal = 0;
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint32 ZoneID = 0;
	uint32 MapID = 0;
	uint32 AreaNb = 0;
	uint32 EntryID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Param = 0;
	uint32 EnemyTargetID = 0;
	uint32 hp = 0;
	Binary CharBin;
	Binary VarBin;
	Binary BinPad;
	BinPad.BytesPad(0,32);
	*pSendMsg<<(uint32)0x020c0200;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad;
	return pSendMsg;
}

Packet* PacketCreator::QUEST_DATA(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#020e0300:32, 16#ffff:16, 0:272, Size:32/little, 0:32, QuestData/binary, 0:32 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsSeasonal = 0;
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint32 ZoneID = 0;
	uint32 MapID = 0;
	uint32 AreaNb = 0;
	uint32 EntryID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint32 Size = 0;
	Binary QuestDataBin;
	Binary BinPad;
	BinPad.BytesPad(0,34);
	*pSendMsg<<(uint32)0x020e0300;
	*pSendMsg<<(uint16)0xffff;
	*pSendMsg<<BinPad;
	*pSendMsg<<Size;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<QuestDataBin;
	*pSendMsg<<(uint32)0;
	return pSendMsg;
}


Packet* PacketCreator::ZONE_DATA(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   
	/*
	packet_send(Client, << 16#020f0300:32, 16#ffff:16, 0:272, SetID, SeasonID, 0:16, Size:32/little, ZoneData/binary >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint8  IsSeasonal = 0;
	uint8  IsGM = 0;
	uint8  OnlineStatus = 0;
	uint8  GameVersion = 0;
	uint32 CharTypeID = 0;
	uint32 SeasonID = 0;
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 SetID = 0;
	uint32 Size = 0;
	Binary ZoneDataBin;
	Binary BinPad;
	BinPad.BytesPad(0,34);
	*pSendMsg<<(uint32)0x020f0300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<SetID;
	*pSendMsg<<SeasonID;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<Size;
	*pSendMsg<<ZoneDataBin;

	return pSendMsg;
}


Packet* PacketCreator::CURRENT_UNIX_TIME(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02100300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:96, UnixTime:32/little >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 UnixTime = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<(uint32)0x02100300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<BinPad2;
	*pSendMsg<<UnixTime;


	return pSendMsg;
}

Packet* PacketCreator::PKT_0x0215(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 UnixTime = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<(uint32)0x02100300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<BinPad2;
	*pSendMsg<<UnixTime;
	return pSendMsg;
}

Packet* PacketCreator::GAMESERVER_IP_PORT(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02160300:32, DestLID:16/little, 0:144, 16#00000f00:32, DestGID:32/little, 0:64, IP/binary, Port:16/little, 0:16 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary IPBin;
	uint16 Port = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x02160300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00000f00;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<IPBin;
	*pSendMsg<<Port;
	*pSendMsg<<(uint16)0;

	return pSendMsg;
}

Packet* PacketCreator::END_CHAR_LOADING(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{ 
	/*
	packet_send(Client, << 16#021b0300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary IPBin;
	uint16 Port = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x021b0300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	return pSendMsg;

}

Packet* PacketCreator::UNIVERSE_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#021e0300:32, 0:288, NbUnis:32/little, UnisBin/binary >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary BinPad;
	BinPad.BytesPad(0,36);
	Binary UnisBin;
	uint32 NbUnis = 0;
	*pSendMsg<<(uint32)0x021e0300;
	*pSendMsg<<BinPad;
	*pSendMsg<<NbUnis;
	*pSendMsg<<UnisBin;
	return pSendMsg;
}

Packet* PacketCreator::CURRENT_UNIVERSE_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02220300:32, 16#ffff:16, 0:16, 16#00001200:32, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64,
	UniID:32/little, NbPlayers:16/little, MaxPlayers:16/little, Name/binary, 0:Padding, LevelCap:32/little >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary BinPad;
	BinPad.BytesPad(0,36);
	Binary UnisBin;
	uint32 UniID = 0;
	uint16 NbPlayers = 0;
	uint16 MaxPlayers = 0;
	Binary NameBin;
	uint32 LevelCap = 0;
	*pSendMsg<<(uint32)0x02220300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<(uint32)0x00001200;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<UniID;
	*pSendMsg<<NbPlayers;
	*pSendMsg<<MaxPlayers;
	*pSendMsg<<NameBin;
	*pSendMsg<<LevelCap;

	return pSendMsg;
}


Packet* PacketCreator::AUTH_KEY(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02230300:32, 0:160, 16#00000f00:32, DestGID:32/little, 0:128, 3:32/little, 0:48, Length:16/little, ErrorMsg/binary, 0:16 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary BinPad;
	BinPad.BytesPad(0,20);
	Binary BinPad2;
	BinPad2.BytesPad(0,16);
	Binary BinPad3;
	BinPad3.BytesPad(0,6);
	uint16 Length = 0;
	Binary ErrorMsgBin;
	*pSendMsg<<(uint32)0x02230300;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00000f00;
	*pSendMsg<<DestGID;
	*pSendMsg<<BinPad2;
	*pSendMsg<<(uint32)3;
	*pSendMsg<<BinPad3;
	*pSendMsg<<Length;
	*pSendMsg<<ErrorMsgBin;
	*pSendMsg<<(uint16)0;
	return pSendMsg;
}

Packet* PacketCreator::MOTD_PAGE(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02250300:32, DestLID:16/little, 0:272, NbPages:8, CurrentPage:8, Length:16/little, Msg/binary, 0:16 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary BinPad;
	uint8  NbPages = 0;
	uint8  CurrentPage = 0;
	uint16 Length = 0;
	Binary MsgBin;
	BinPad.BytesPad(0,34);
	*pSendMsg<<(uint32)0x02250300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<NbPages;
	*pSendMsg<<CurrentPage;
	*pSendMsg<<Length;
	*pSendMsg<<MsgBin;
	*pSendMsg<<(uint16)0;

	return pSendMsg;

}

Packet* PacketCreator::NOTICE_MESSASG(NoticeParam &Param,Binary &MsgBin)
{
  
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary MsgBin;
	*pSendMsg<<(uint32)0x02280300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<Param.DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<Param.TypeInt;
	*pSendMsg<<Param.Duration;
	*pSendMsg<<MsgBin;
	*pSendMsg<<(uint16)0;
	return pSendMsg;

}

Packet* PacketCreator::SPAWN_PLAYER_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#02330300:32, DestLID:16/little, 0:16, 16#00001200:32, DestGID:32/little, 0:64,
	16#00011300:32, DestGID:32/little, 0:64, NbUsers:32/little, Bin/binary, 0:608 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	Binary BinPad;
	BinPad.BytesPad(0,76);
	Binary Bin;
	uint32 Nbusers = 0;
	*pSendMsg<<(uint32)0x02330300;
	*pSendMsg<<DestLID;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<(uint32)0x00001200;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<Nbusers;
	*pSendMsg<<Bin;
	*pSendMsg<<BinPad;
	return pSendMsg;

}

Packet* PacketCreator::LOAD_ZONE_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#02360300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary Bin;
	uint32 Nbusers = 0;
	*pSendMsg<<(uint32)0x02360300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	return pSendMsg;
}

Packet* PacketCreator::CHAT_MESSAGE(ChatParam &param,Binary &NameBin,Binary &MsgBin)
{
	
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	*pSendMsg<<(uint32)0x03040300;
	*pSendMsg<<param.DestLID;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<param.FromGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<param.DestGID;
	*pSendMsg<<param.ChatTypeID;
	*pSendMsg<<param.FromGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<param.ChatType;
	*pSendMsg<<param.ChatCutIn;
	*pSendMsg<<param.ChatCutInAngle;
    uint8 ChatMsgLength = MsgBin.getSize();
	*pSendMsg<<ChatMsgLength;
	*pSendMsg<<param.ChatChannel;
	*pSendMsg<<param.ChatCharacterType;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<NameBin;
	*pSendMsg<<MsgBin;
	return pSendMsg;

}

Packet* PacketCreator::WARPS_PLAYER(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   
	/*
	packet_send(Client, << 16#05030300:32, 0:64, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, DestGID:32/little, 0:32,
	16#1000:16, IntDir:16/little, PrevX:32/little-float, PrevY:32/little-float, PrevZ:32/little-float, X:32/little-float, Y:32/little-float, Z:32/little-float,
	QuestID:32/little, ZoneID:32/little, MapID:32/little, EntryID:32/little, 1:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint16 IntDir = 0;
	float  PrevX = 0.0f;
	float  PrevY = 0.0f;
	float  PrevZ = 0.0f;
	float  X = 0.0f;
	float  Y = 0.0f;
	float  Z = 0.0f;
	uint32 QuestID = 0;
	uint32 ZoneID = 0;
	uint32 MapID = 0;
	uint32 EntryID = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x05030300;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint16)0x1000;
	*pSendMsg<<IntDir;
	*pSendMsg<<PrevX;
	*pSendMsg<<PrevY;
	*pSendMsg<<PrevZ;
	*pSendMsg<<X;
	*pSendMsg<<Y;
	*pSendMsg<<Z;
	*pSendMsg<<QuestID;
	*pSendMsg<<ZoneID;
	*pSendMsg<<MapID;
	*pSendMsg<<EntryID;
	*pSendMsg<<(uint32)1;
	return pSendMsg;

}

Packet* PacketCreator::NPC_INVENTORY(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#0a040300:32, 0:32, 16#00001d00:32, NPCGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, Bin/binary >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCGID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary Bin;
	uint32 Nbusers = 0;
	*pSendMsg<<(uint32)0x0a040300;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0x00001d00;
	*pSendMsg<<NPCGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<Bin;
	return pSendMsg;
}

Packet* PacketCreator::ITEMUUID_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{ 
	/*
	packet_send(Client, << 16#0a060300:32, DestLID:16/little, 0:48, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, Bin/binary, Bin2/binary >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCGID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	Binary BinPad;
	BinPad.BytesPad(0,6);
	Binary Bin,Bin2;
	uint32 Nbusers = 0;
	*pSendMsg<<(uint32)0x0a060300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<Bin;
	*pSendMsg<<Bin2;
	return pSendMsg;

}

Packet* PacketCreator::ITEM_DESCRIPTION(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#0a110300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64,
	ItemID:32, Length:32/little, ItemDesc/binary, 0:16 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCGID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	uint32 ItemID = 0;
	uint32 Length = 0;
	Binary ItemDesc;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x0a110300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	return pSendMsg;

}

Packet* PacketCreator::QUEST_INIT(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#0c000300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64, QuestID:32/little,
	16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32,
	16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32,
	16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32,
	16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCGID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	uint32 QuestID  =0 ;
	uint32 ItemID = 0;
	uint32 Length = 0;
	Binary ItemDesc;
	Binary BinPad;
	BinPad.BytesPad(0,128);
	*pSendMsg<<(uint32)0x0c000300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<QuestID;
	*pSendMsg<<BinPad;
	return pSendMsg;

}

Packet* PacketCreator::QUEST_FILE(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#0c060300:32, 0:288, 1:32/little, Pack/binary >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCGID = 0;
	uint32 TypeInt = 0;
	uint32 Duration = 0;
	uint32 QuestID  =0 ;
	Binary QuestPack;
	Binary BinPad;
	BinPad.BytesPad(0,36);
	*pSendMsg<<(uint32)0x0c060300;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<QuestPack;
	return pSendMsg;

}

Packet* PacketCreator::ALLOW_PLAYER_TRANSPORT(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#0c080300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:96 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<(uint32)0x0c080300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<BinPad2;
	return pSendMsg;

}


Packet* PacketCreator::TRIAL_START_NOTIFICATION(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#0c090300:32, 0:160, 16#00011300:32, DestGID:32/little, 0:64, 0:64 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary BinPad;
	BinPad.BytesPad(0,20);
	*pSendMsg<<(uint32)0x0c090300;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint64)0;
	return pSendMsg;

}


Packet* PacketCreator::MISSION_OPTION(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#0c100300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64, 1, 0, Size:16/little, Options/binary >>).
	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint16 Size = 0;
	Binary OptionBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x0c100300;
	*pSendMsg<<DestLID;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<Size;
	*pSendMsg<<OptionBin;
	return pSendMsg;
}



Packet* PacketCreator::CHAR_GENERAL_DATA(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{   


	/*
	packet_send(Client, << 16#0d010300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, CharBin/binary,
	16#ffbbef1c:32, 16#f8ff0700:32, 16#fc810916:32, 16#7802134c:32, 16#b0c0040f:32, 16#7cf0e583:32,
	16#b7bce0c6:32, 16#7ff8f963:32, 16#3fd7ffff:32, 16#fff7ffff:32, 16#f3ff63e0:32, 16#1fe00000:32,
	0:7744, OptionsBin/binary >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint16 Size = 0;
	Binary CharBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	Binary BinPad2;
	BinPad2.BytesPad(0,968);
	Binary OptionsBin;
	*pSendMsg<<(uint32)0x0d010300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CharBin;
	*pSendMsg<<(uint32)0xffbbef1c;
	*pSendMsg<<(uint32)0xf8ff0700;
	*pSendMsg<<(uint32)0xfc810916; 
	*pSendMsg<<(uint32)0x7802134c;
	*pSendMsg<<(uint32)0xb0c0040f; 
	*pSendMsg<<(uint32)0x7cf0e583;
	*pSendMsg<<(uint32)0xb7bce0c6; 
	*pSendMsg<<(uint32)0x7ff8f963; 
	*pSendMsg<<(uint32)0x3fd7ffff; 
	*pSendMsg<<(uint32)0xfff7ffff; 
	*pSendMsg<<(uint32)0xf3ff63e0; 
	*pSendMsg<<(uint32)0x1fe00000;
	*pSendMsg<<BinPad2;
	*pSendMsg<<OptionsBin;
	return pSendMsg;
}

Packet* PacketCreator::CHAR_LIST(character* chars[])
{
	/*
	packet_send(Client, << 16#0d030300:32, 0:32, 16#00011300:32, DestGID:32/little, 0:64,
	16#00011300:32, DestGID:32/little, 0:104,
	Status0:8, 0:48, Char0/binary, 0:520,
	Status1:8, 0:48, Char1/binary, 0:520,
	Status2:8, 0:48, Char2/binary, 0:520,
	Status3:8, 0:48, Char3/binary, 0:512 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint16 Size = 0;
	uint8  Status0 = 0;
	uint8  Status1 = 0;
	uint8  Status2 = 0;
	uint8  Status3 = 0;
	Binary CharBin0;
	Binary CharBin1;
	Binary CharBin2;
	Binary CharBin3;
	Binary OptionBin;
	Binary BinPad;
	BinPad.BytesPad(0,13);
	*pSendMsg<<(uint32)0x0d030300;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<BinPad;
	*pSendMsg<<Status0;
	Binary pad0;
	pad0.BytesPad(0,6);
	*pSendMsg<<pad0;
	*pSendMsg<<CharBin0;
	Binary pad1;
	pad1.BytesPad(0,65);
	*pSendMsg<<pad1;
	*pSendMsg<<Status1;
	*pSendMsg<<pad0;
	*pSendMsg<<CharBin1;
	*pSendMsg<<pad1;
	//
	*pSendMsg<<Status2;
	*pSendMsg<<pad0;
	*pSendMsg<<CharBin2;
	*pSendMsg<<pad1;
	//
	*pSendMsg<<Status3;
	*pSendMsg<<pad0;
	*pSendMsg<<CharBin3;
	*pSendMsg<<pad1;
	//...
	return pSendMsg;

}

Packet* PacketCreator::FLAG_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{  

	/*
	Packet = << 16#0d050300:32, 0:32, 16#00011300:32, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, Flags/binary >>,
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary FlagBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x0d050300;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<FlagBin;

	return pSendMsg;

}


Packet* PacketCreator::ADD_PARTY_MEMBER(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#10040300:32, 16#ffff0000:32, 0:128, 16#00011300:32, DestGID:32/little, 0:64,
	TypeID:32, GID:32/little, 0:64, Name/binary,
	Level:16/little, 16#ffff:16,
	SomeFlag, 1, PartyPos:8, 1,
	NPCid:16/little, 0:16,
	%% Odd unknown values. PA related? No idea. Values on invite, 0 in-mission.
	%~ 16#00001f08:32, 0:32, 16#07000000:32,
	%~ 16#04e41f08:32, 0:32, 16#01000000:32,
	%~ 16#64e41f08:32, 0:32, 16#02000000:32,
	%~ 16#64e41f08:32, 0:32, 16#03000000:32,
	%~ 16#64e41f08:32, 0:32, 16#12000000:32,
	%~ 16#24e41f08:32,
	0:512,
	QuestID:32/little, ZoneID:32/little, MapID:32/little, EntryID:32/little,
	LID:32/little,
	0:64,
	16#01000000:32, 16#01000000:32, %% @todo first is current hp, second is max hp
	0:608 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 TypeID = 0;
	uint32 GID = 0;
	Binary NameBin;
	uint16 Level = 0;
	uint32 SomeFlag = 0;
	uint8 PartyPos = 0;
	uint16 NPCid = 0;
	uint32 QuestID = 0;
	uint32 ZoneID = 0;
	uint32 MapID = 0;
	uint32 EntryID = 0;
	uint32 LID  = 0;
	Binary FlagBin;
	Binary BinPad;
	BinPad.BytesPad(0,16);
	*pSendMsg<<(uint32)0x10040300;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<TypeID;
	*pSendMsg<<GID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<NameBin;
	*pSendMsg<<Level;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<SomeFlag;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<PartyPos;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<NPCid;
	*pSendMsg<<(uint16)0;
	Binary BinPad2;
	BinPad2.BytesPad(0,64);
	*pSendMsg<<BinPad2;
	*pSendMsg<<QuestID;
	*pSendMsg<<ZoneID;
	*pSendMsg<<MapID;
	*pSendMsg<<EntryID;
	*pSendMsg<<LID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x01000000;
	*pSendMsg<<(uint32)0x01000000;
	Binary BinPad3;
	BinPad3.BytesPad(0,76);
	*pSendMsg<<BinPad3;

	return pSendMsg;

}

Packet* PacketCreator::PARTY_MEMBER_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{ 
	/*
	packet_send(Client, << 16#10050300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64,
	16#00000100:32, 0:32, 16#ffffffff:32, 0:32, 16#00011200:32, DestGID:32/little, 0:64,
	Name/binary, Level:8, 0:16, 1:8, 16#01010000:32, 0:32, Location/binary,
	16#ffffffff:32, 0:96, 16#ffffffff:32, 0:64, CurrentHP:32/little, MaxHP:32/little, 0:640,
	16#0100ffff:32, 16#0000ff00:32, 16#ffff0000:32, 0:640, 16#ffffffff:32, 0:768,
	16#0100ffff:32, 16#0000ff00:32, 16#ffff0000:32, 0:640, 16#ffffffff:32, 0:768,
	16#0100ffff:32, 16#0000ff00:32, 16#ffff0000:32, 0:640, 16#ffffffff:32, 0:768,
	16#0100ffff:32, 16#0000ff00:32, 16#ffff0000:32, 0:640, 16#ffffffff:32, 0:768,
	16#0100ffff:32, 16#0000ff00:32, 16#ffff0000:32, 0:640, 16#ffffffff:32, 0:448,
	16#ffffffff:32, 0:32, 16#ff020000:32, 16#ffff0000:32, 16#ffff0000:32, 16#ffff0000:32,
	16#ffff0000:32, 16#ffff0000:32, 16#ffff0000:32, 0:3680 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	Binary NameBin;
	uint8  Level = 0;
	uint32 CurrentHp = 0;
	uint32 MaxHp = 0;
	Binary LocationBIn;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x10050300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)0x00000100;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0x00011200;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<NameBin;
	*pSendMsg<<Level;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<(uint8)1;
	*pSendMsg<<(uint32)0x01010000;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<LocationBIn;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<BinPad2;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<CurrentHp;
	*pSendMsg<<MaxHp;
	Binary BinPad3;
	BinPad3.BytesPad(0,80);
	Binary BinPad4;
	BinPad4.BytesPad(0,96);
	*pSendMsg<<BinPad3;
	*pSendMsg<<(uint32)0x0100ffff;
	*pSendMsg<<(uint32)0x0000ff00;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad3;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<BinPad4;
	*pSendMsg<<(uint32)0x0100ffff;
	*pSendMsg<<(uint32)0x0000ff00;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad3;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<BinPad4;
	*pSendMsg<<(uint32)0x0100ffff;
	*pSendMsg<<(uint32)0x0000ff00;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad3;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<BinPad4;
	*pSendMsg<<(uint32)0x0100ffff;
	*pSendMsg<<(uint32)0x0000ff00;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad3;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<BinPad4;
	*pSendMsg<<(uint32)0x0100ffff;
	*pSendMsg<<(uint32)0x0000ff00;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<BinPad3;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	Binary BinPad5;
	BinPad5.BytesPad(0,56);
	*pSendMsg<<BinPad5;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0xff020000;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<(uint32)0xffff0000;
	*pSendMsg<<(uint32)0xffff0000;
	Binary BinPad6;
	BinPad6.BytesPad(0,460);
	*pSendMsg<<BinPad6;

	return pSendMsg;

}

Packet* PacketCreator::PARTY_RELATED_EVENT(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#10060300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, EventID:8, PartyPos:8, 0:16 >>).
	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint8 partyPos = 0;
	Binary FlagBin;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x10060300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<EventID;
	*pSendMsg<<partyPos;
	*pSendMsg<<(uint16)0;
	return pSendMsg;
}


Packet* PacketCreator::CURRENT_LOCATION(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/* 
	packet_send(Client, << 16#100e0300:32, 16#ffffffbf:32, 0:128, 16#00011300:32, DestGID:32, 0:64,
	1, PartyPos, 0:48, 16#ffffff7f:32, UCS2Name/binary, 0:Padding, 0:32, CounterID:32/little, CounterType:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint8 partyPos = 0;
	uint32 CounterID = 0;
	uint32 CounterType = 0;
	Binary FlagBin;
	Binary BinPad;
	BinPad.BytesPad(0,16);
	*pSendMsg<<(uint32)0x100e0300;
	*pSendMsg<<(uint32)0xffffffbf;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<partyPos;
	Binary BinPad2;
	BinPad2.BytesPad(0,6);
	*pSendMsg<<BinPad2;
	*pSendMsg<<(uint32)0xffffff7f;
	Binary NameBin;
	*pSendMsg<<NameBin;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<CounterID;
	*pSendMsg<<CounterType;

	return pSendMsg;
}


Packet* PacketCreator::CURRENT_LOCATION_EX(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/* 
	packet_send(Client, << 16#100e0300:32, 16#ffffffbf:32, 0:128, 16#00011300:32, DestGID:32, 0:64,
	1, PartyPos, ZoneID:16/little, MapID:16/little, EntryID:16/little, QuestID:32/little,
	UCS2Name/binary, 0:Padding, 0:32, 16#ffffffff:32, 0:32 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 EventID = 0;
	uint8 partyPos = 0;
	uint32 CounterID = 0;
	uint32 CounterType = 0;
	uint32 ZoneID = 0;
	uint32 MapID  = 0;
	uint32 EntryID = 0;
	uint32 QuestID = 0;
	Binary FlagBin;
	Binary BinPad;
	BinPad.BytesPad(0,16);
	*pSendMsg<<(uint32)0x100e0300;
	*pSendMsg<<(uint32)0xffffffbf;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<partyPos;
	*pSendMsg<<ZoneID;
	*pSendMsg<<MapID;
	*pSendMsg<<EntryID;
	*pSendMsg<<QuestID;
	Binary NameBin;
	*pSendMsg<<NameBin;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	*pSendMsg<<(uint32)0;


	return pSendMsg;
}


Packet* PacketCreator::PARTY_LOCATION_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#100f0300:32, 0:160, 16#00011300:32, DestGID:32/little, 0:64, NPCid:16/little, 1, PartyPos:8, PartyPos:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8 partyPos = 0;
	Binary FlagBin;
	Binary BinPad;
	BinPad.BytesPad(0,20);
	*pSendMsg<<(uint32)0x100f0300;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<NPCID;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<partyPos;
	*pSendMsg<<(uint32)partyPos;

	return pSendMsg;
}

Packet* PacketCreator::MISSION_FILE(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#10150300:32, 0:160, 16#00011300:32, DestGID:32/little, 0:64, QuestID:32/little, 16#01010000:32, 0:32, Size:32/little, QuestData/binary >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8 partyPos = 0;
	uint32 QuestID = 0;
	uint32 Size = 0;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,20);
	*pSendMsg<<(uint32)0x10150300;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<QuestID;
	*pSendMsg<<(uint32)0x01010000;
	*pSendMsg<<(uint32)0;
	*pSendMsg<<Size;
	*pSendMsg<<QuestData;
	return pSendMsg;

}

Packet* PacketCreator::PKT_0x1016(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#10160300:32, 16#ffff0000:32, 0:128, 16#00011300:32, DestGID:32/little, 0:64, PartyPos:32/little >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8 partyPos = 0;
	uint32 QuestID = 0;
	uint32 Size = 0;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,20);
	*pSendMsg<<(uint32)0x10160300;
	*pSendMsg<<(uint32)0xFFFF0000;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<partyPos;
	return pSendMsg;
}

Packet* PacketCreator::PKT_0x101a(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	101a(NPCid, PartyPos, Client=#client{gid=DestGID}) ->
	packet_send(Client, << 16#101a0300:32, 0:160, 16#00011300:32, DestGID:32/little, 0:64, NPCid:16/little, PartyPos:16/little, 16#ffffffff:32 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8 partyPos = 0;
	uint32 QuestID = 0;
	uint32 Size = 0;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,20);
	*pSendMsg<<(uint32)0x101a0300;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<NPCID;
	*pSendMsg<<(uint16)partyPos;
	*pSendMsg<<(uint32)0xFFFFFFFF;
	return pSendMsg;

}


Packet* PacketCreator::MISSION_START_RELATED(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#10200300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8 partyPos = 0;
	uint32 QuestID = 0;
	uint32 Size = 0;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x10200300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	return pSendMsg;

}

Packet* PacketCreator::UPDATE_PAERTY_MEMBER_HP(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*packet_send(Client, << 16#10220300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, HP:32/little, PartyPos:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 QuestID = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x10220300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<HP;
	*pSendMsg<<partyPos;


	return pSendMsg;
}


Packet* PacketCreator::OBJECT_EVENT_RESPON(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#12050300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, EventID, BlockID, 0:16, Value, 0:24 >>).

	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 EventID = 0;
	uint32 BlockID = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x12050300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<EventID;
	*pSendMsg<<BlockID;
	*pSendMsg<<(uint16)0;
	Binary value;
	*pSendMsg<<value;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	return pSendMsg;
}

Packet* PacketCreator::PKT_0x1211(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#12110300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, A:32/little, B:32/little, C:32/little, D:32/little >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 EventID = 0;
	uint32 BlockID = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 A,B,C,D;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x12110300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<A;
	*pSendMsg<<B;
	*pSendMsg<<C;
	*pSendMsg<<D;
	return pSendMsg;

}


Packet* PacketCreator::LOAD_QUEST_PREVIOUSLY(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#12120300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, 0:19200 >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 EventID = 0;
	uint32 BlockID = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 A,B,C,D;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x12120300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	Binary BinPad2;
	BinPad2.BytesPad(0,1);
	*pSendMsg<<BinPad2;
	return pSendMsg;

}


Packet* PacketCreator::KET_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#12130300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, A:32/little, B:32/little >>).
	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 A,B,C,D;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x12130300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<A;
	*pSendMsg<<B;
	return pSendMsg;

}

Packet* PacketCreator::BOSS_GATE_SET(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#12150300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64, A:32/little, 0:16, B:16/little >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 A,B,C,D;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x12150300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<A;
	*pSendMsg<<(uint16)0;
	*pSendMsg<<(uint16)B;
	return pSendMsg;

}

Packet* PacketCreator::PKT_0x1216(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#12160300:32, 0:32, 16#00011300:32, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, Value:32/little >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 A = 0;
	uint32 B = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 Value;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x12150300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	*pSendMsg<<Value;

	return pSendMsg;
}


Packet* PacketCreator::PLAYER_PARTNER_CARD(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#15000300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:64,
	Name/binary, RaceBin:8, GenderBin:8, ClassBin:8, VoiceType:8, VoicePitch:8, 0:24,
	DestGID:32/little, 0:224, Comment/binary, 1, 4, 1, Slot, 0:64 >>).

	*/

	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 RaceBin = 0;
	uint8  GenderBin = 0;
	uint8  ClassBin= 0;
	uint8  VoiceType = 0;
	uint8  VoicePitch = 0;
	Binary Comment;
	uint8  Slot;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x15000300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	*pSendMsg<<(uint64)0;
	Binary NameBin;
	*pSendMsg<<NameBin;
	*pSendMsg<<RaceBin;
	*pSendMsg<<GenderBin;
	*pSendMsg<<ClassBin;
	*pSendMsg<<VoiceType;
	*pSendMsg<<VoicePitch;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<DestGID;
	Binary BinPad2;
	BinPad2.BytesPad(0,28);
	*pSendMsg<<BinPad2;
	*pSendMsg<<Comment;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<(uint32)4;
	*pSendMsg<<(uint32)1;
	*pSendMsg<<Slot;
	*pSendMsg<<(uint64)0;

	return pSendMsg;
}

Packet* PacketCreator::PARTNERCARD_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{

	/*
	packet_send(Client, << 16#15010300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:96 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 A = 0;
	uint32 B = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 Value;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x15010300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<BinPad2;


	return pSendMsg;

}

Packet* PacketCreator::BLOCK_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{


	/*
	packet_send(Client, << 16#15120300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:46144 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint8  partyPos = 0;
	uint32 A = 0;
	uint32 B = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 Value;
	Binary QuestData;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x15120300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	Binary BinPad2;
	BinPad2.BytesPad(0,1);
	*pSendMsg<<BinPad2;


	return pSendMsg;

}

Packet* PacketCreator::PM_INFO(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{
	/*
	packet_send(Client, << 16#16020300:32, 16#ffff:16, 0:144, 16#00011300:32, DestGID:32/little, 0:96,
	Bin/binary, 0:MiddlePaddingSize, NbNPC, 0:24, UCS2PMName/binary, 0:EndPaddingSize, 0:32 >>).

	*/
	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint32  NbNPC = 0;
	uint8  partyPos = 0;
	uint32 A = 0;
	uint32 B = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 Value;
	Binary PMName;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x16020300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<BinPad2;
	Binary Bin;
	*pSendMsg<<Bin;
	*pSendMsg<<NbNPC;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<PMName;
	*pSendMsg<<(uint32)0;


	return pSendMsg;

}


Packet* PacketCreator::PARTY_LIST(SOCKET_FD* lpSocketFD, MSG_BASE *pMsg, uint16 wSize)
{


	Packet *pSendMsg = PacketFactory::Instance()->Alloc();
	uint16 DestLID = 0;
	uint32 DestGID = 0;
	uint32 CharGID = 0;
	uint32 CharLID = 0;
	uint32 NPCID = 0;
	uint32  NbNPC = 0;
	uint8  partyPos = 0;
	uint32 A = 0;
	uint32 B = 0;
	uint32 Size = 0;
	uint32 HP = 0;
	uint32 Value;
	Binary PMName;
	Binary BinPad;
	BinPad.BytesPad(0,18);
	*pSendMsg<<(uint32)0x16020300;
	*pSendMsg<<(uint16)0xFFFF;
	*pSendMsg<<BinPad;
	*pSendMsg<<(uint32)0x00011300;
	*pSendMsg<<DestGID;
	Binary BinPad2;
	BinPad2.BytesPad(0,12);
	*pSendMsg<<BinPad2;
	Binary Bin;
	*pSendMsg<<Bin;
	*pSendMsg<<NbNPC;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<(uint8)0;
	*pSendMsg<<PMName;
	*pSendMsg<<(uint32)0;


	return pSendMsg;

}